package com.pr.util;

/**
 * @description:
 * @projectName:spring-skill
 * @see:com.pr.util
 * @author:LXC
 * @createTime:2024/7/22 15:42
 * @version:1.0
 */
public class CaculateUtil {

    public static void simpleTryCatch() {
        try {
            testNPE();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void testNPE(){
        int num = 3/0;
    }

    public static <T extends Number> double add(T a, T b) {
        System.out.println(a + "+" + b + "=" + (a.doubleValue() + b.doubleValue()));
        return a.doubleValue() + b.doubleValue();
    }
}
